<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  
    xmlns:h="http://java.sun.com/jsf/html"  
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"  
    xmlns:p="http://primefaces.org/ui"> 
	<h:head>
	    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	    <link href="${facesContext.externalContext.requestContextPath}/css/format.css" rel="stylesheet" type="text/css"/>
	    <title>Facelets Template</title>
	</h:head>
	<h:body>
	     <ui:composition template="/template.xhtml">
	        <ui:define name="ui_right">
				<h:form prependId="false">  
				  
				    <p:growl id="msgs" />  
				  
				    <p:panel header="Dodaj ogłoszenie...">  
				        <h:panelGrid columns="2" columnClasses="column" cellpadding="5">  
				            <h:outputText value="Tytuł: " />  
				            <p:inplace id="tytulInplace" editor="true">  
				                <p:inputText value="#{inplaceBean.tytul}" required="true" label="text"/>  
				            </p:inplace>
				            
				            <h:outputText value="Treść: " />  
				            <p:inplace id="trescInplace" editor="true">
				            	<p:inputTextarea value="#{inplaceBean.tresc}" required="true" label="text"/>
				            </p:inplace>
				  
				            <h:outputText value="Kategoria: "/>  
				            <p:inplace id="kategoriaInplace" label="Kategoria" effectSpeed="fast" event="dbclick">  
				                <h:selectOneMenu>  
				                    <f:selectItem itemLabel="Istanbul" itemValue="Istanbul" />  
				                    <f:selectItem itemLabel="Ankara" itemValue="Ankara" />  
				                    <f:selectItem itemLabel="Istanbul" itemValue="Istanbul" />  
				                </h:selectOneMenu>  
				            </p:inplace>  
				            
				            <h:outputText value="Zdjęcia: " />  
				            <p:inplace id="slidingInplace" label="Dodaj" effect="slide">  
				                <h:form enctype="multipart/form-data">  
								    <p:fileUpload fileUploadListener="#{fileUploadController.handleFileUpload}"  
								            mode="advanced"  
								            update="messages"   
								            multiple="true"  
								            sizeLimit="100000"   
								            allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>  
								  
								    <p:growl id="messages" showDetail="true"/>  
								  
								</h:form>   
				            </p:inplace> 
				            <p:commandButton value="Akceptuj"/> 
				        </h:panelGrid>  
				    </p:panel>  
				  
				</h:form>  
	        </ui:define>
	    </ui:composition>
	</h:body>
</html>
